package com.ruoyi.partybuilding.domain;

import java.util.Date;
import java.util.List;

import com.easy.query.core.annotation.EasyWhereCondition;
import com.easy.query.core.annotation.Navigate;
import com.easy.query.core.annotation.Table;
import com.easy.query.core.enums.RelationTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.partybuilding.common.EQuery.CU2Entity;
import com.ruoyi.partybuilding.common.EQuery.IDeptEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.*;

import static com.easy.query.core.annotation.EasyWhereCondition.Condition.RANGE_LEFT_CLOSED;
import static com.easy.query.core.annotation.EasyWhereCondition.Condition.RANGE_RIGHT_CLOSED;

/**
 * 评议对象 pb_review
 * 
 * @author he-liangliang@outlook.com
 * @date 2024-11-27
 */

@Table("pb_review")
@Data
public class Review extends CU2Entity.LongId implements IDeptEntity
{
    private static final long serialVersionUID = 1L;


    /** 部门id ; */
    @ApiModelProperty(value = "部门id")
    @Excel(name = "部门id")
    private Long deptId;

    /** 名称 ; */
    @ApiModelProperty(value = "名称")
    @Excel(name = "名称")
    private String title;

    /** 开始时间 ; */
    @ApiModelProperty(value = "开始时间")
    @EasyWhereCondition(type =RANGE_LEFT_CLOSED )
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date begin;

    /** 结束时间 ; */
    @ApiModelProperty(value = "结束时间")
    @EasyWhereCondition(type =RANGE_RIGHT_CLOSED )
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date end;

    /** 详情 ; */
    @ApiModelProperty(value = "详情")
    @Excel(name = "详情")
    private String details;

    /** 附件，json[] ; */
    @ApiModelProperty(value = "附件，json[]")
    @Excel(name = "附件，json[]")
    private String files;

    /**  状态：0执行中，1已结束,2未开始 */
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    @ApiModelProperty(value = "状态：0执行中，1已结束,2未开始")
     Integer status;

    @ApiModelProperty(value = "相关被评议人、评议人")
    @Navigate(value = RelationTypeEnum.OneToMany,targetProperty = "reviewId", selfProperty = "id")
    List<ReviewStaffs> staffs;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("deptId", getDeptId())
            .append("title", getTitle())
            .append("begin", getBegin())
            .append("end", getEnd())
            .append("details", getDetails())
            .append("files", getFiles())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
